package com.msb.serviceprice.generator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * @Auther: jiudianliu
 * @Date: 2023/7/1 - 07 - 01 - 18:36
 * @Description: com.msb.serviceDriverUser.generator
 * @version: 1.0
 */
/*
* 自动生成代码工具类
* */
public class MySqlGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-price?characterEncoding=utf-8&serverTimezone=GMT%2B8",
                "root","root")
                .globalConfig(builder -> {
                    builder.author("jiudianliu").fileOverride().outputDir("Z:\\000_m\\Java\\online-taxi-public\\online-taxi-2023-public\\online-taxi-public\\service-price\\src\\main\\java");
        })
                .packageConfig(builder -> {
                    builder.parent("com.msb.serviceprice").pathInfo(Collections.singletonMap(OutputFile.mapperXml,
                            "Z:\\000_m\\Java\\online-taxi-public\\online-taxi-2023-public\\online-taxi-public\\service-price\\src\\main\\java\\com\\msb\\serviceprice\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("price_rule");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
